package com.gewu.pm.ui.adapter.home;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.gewu.pm.R;
import com.gewu.pm.app.AppAdapter;
import com.gewu.pm.bean.TestBean;

/**
 * 日报报表的  已交和未交人员列表
 */
public class ReportPersonAdapter extends AppAdapter<TestBean> {

    public ReportPersonAdapter(Context context) {
        super(context);
    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new ItemViewHolder();
    }

    private final class ItemViewHolder extends AppAdapter<TestBean>.ViewHolder {

        private final ImageView mAvatarView;
        private final TextView mNameView;

        private ItemViewHolder() {
            super(R.layout.item_daily_report_person);
            
            mAvatarView = findViewById(R.id.iv_avatar);
            mNameView = findViewById(R.id.tv_name);
        }

        @Override
        public void onBindView(int position) {
            TestBean item = getItem(position);
            
            // 设置姓名
            mNameView.setText(item.getName());
            
            // 设置头像（使用默认头像，实际项目中可根据需要加载网络图片）
            mAvatarView.setImageResource(R.drawable.head_other);
        }
    }
}
